package com.pig4cloud.pigx.pay.mq;

import com.pig4cloud.pigx.pay.entity.PayTradeOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * <p>Project: bblocks-pro - Consumer</p>
 * <p>描述：支付结果测试用（支付结果是广播的）</p>
 *
 * @Author Zhao [125043150@qq.com]
 * @Date 2023/11/5 16:32
 * @Version 1.0
 * @since 8
 */
@Slf4j
@Component
public class Consumer {

    @RabbitHandler
    @RabbitListener(queues = {"topic.yuezhu.pay.result"},
              containerFactory = "customContainerFactory")
    public void payResult(PayTradeOrder payOrder) {
        log.info("收到订单：{} 支付结果：{}",payOrder.getReqNo(),payOrder);
    }

}
